﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

using EHTSaleManager.Code.BLL;
using EHTSaleManager.Code.Entity;
using EHTSaleManager.Code.Utility;

namespace EHTSaleManager.UIAdmin
{
    public partial class AdminIndex : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Int32 totalOrderAppending = 0;
            Int32 totalOrderShipping = 0;
            OrderProvider.GetParametersOfOrder(out totalOrderAppending, out totalOrderShipping);
            this.hlOrderAppending.Text = "Order Føye (" + totalOrderAppending.ToString() + ")";
            this.hlOrderShipping.Text = "Order Skipsfart (" + totalOrderShipping.ToString() + ")";

            MembershipUserCollection userList = new MembershipUserCollection();
            MembershipUserCollection allUser = Membership.GetAllUsers(); // lấy tất cả User

            // chọn các user thuộc nhóm Customer
            foreach (MembershipUser theUser in allUser)
            {
                if (Roles.IsUserInRole(theUser.UserName, HangSo.ROLE_CUSTOMER))
                {
                    userList.Add(theUser);
                }
            }

            this.hlCustomerNotApprove.Text = "Cusomer Manager (" + userList.Count.ToString() + ")";
        }
    }
}